<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
	
    <h:body>
		<ui:composition template="/admin/template.xhtml">		    			
		<p:panel header="Delegace">	
			<h:panelGrid columns="2">
				<p:panel header="Administrace delegací z České republiky" style="min-width:500px;min-height: 1129px;">
					<h:panelGrid columns="1">	
							           			
	            				<h:form id="detailDelegace" >
										<p:dataTable var="delegation" value="#{delegationczechBean.delegationczech}" rowKey="#{delegation.id}" selection="#{delegationczechBean.selecteddelegationczech}" emptyMessage="Žádné delegace nenalezeny" selectionMode="single" tableStyle="min-width:300px;" paginatorAlwaysVisible="false" paginatorPosition="bottom"  paginator="true" rows="15">
									        <p:column headerText="soutěž">  
									            <h:outputText value="#{delegation.competion}" />  
									        </p:column>
									        <p:column headerText="datum">  
									            <h:outputText value="#{delegation.date}" />  
									        </p:column>
									        <p:column headerText="čas">  
									            <h:outputText value="#{delegation.time}" />  
									        </p:column>
									        <p:column headerText="domácí">  
									            <h:outputText value="#{delegation.homeTeam}" />  
									        </p:column>
									        <p:column headerText="hosté">  
									            <h:outputText value="#{delegation.awayTeam}" />  
									        </p:column>
									        <p:column headerText="hlavní rozhodčí">  
									            <h:outputText value="#{delegation.mainReferee}" />  
									        </p:column>
									        <p:column headerText="AR1">  
									            <h:outputText value="#{delegation.lineRefereeOne}" />  
									        </p:column>
									        <p:column headerText="AR2">  
									            <h:outputText value="#{delegation.lineRefereeTwo}" />  
									        </p:column>
									        <p:column headerText="DS">  
									            <h:outputText value="#{delegation.ds}" />  
									        </p:column>
									        <p:column headerText="spolujízda">  
									            <h:outputText value="#{delegation.carpool}" />  
									        </p:column>
									        <p:column headerText="poznámka">  
									            <h:outputText value="#{delegation.note}" />  
									        </p:column>									        
									        <f:facet name="footer">  
								             	<p:commandButton  value="upravit"  update=":delegationEditDialog" oncomplete="delegationEditDialog.show()"/>   
						       					<p:commandButton  id="newDelegationButton" value="nová delegace"  update=":detailDelegace" oncomplete="delegationNewDialog.show()"/>     
												<p:commandButton value="Odstranit"  actionListener="#{delegationczechBean.deleteDelegationczech}" update=":detailDelegace,:growl"/>
						       				</f:facet> 
							  	        </p:dataTable>
					  	        </h:form>
					  	       
					  	       <p:dialog id="delegationNewDialog" header="Nová delegace" widgetVar="delegationNewDialog" resizable="false"  
					              width="300" showEffect="clip" hideEffect="fold" position="10,10">  
						      	 <h:form>   
						      	    <h:panelGrid columns="2" cellpadding="4">
						      	       <h:outputText value="Soutěž:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.competion}" style="width:150px"/>  
							           <h:outputText value="Datum:" />    						      
							           <p:inputMask value="#{delegationczechBean.newdelegationczech.date}" mask="99.99.9999" style="width:70px"/>
							           <h:outputText value="čas:" />    						      
							           <p:inputMask value="#{delegationczechBean.newdelegationczech.time}" mask="99:99" style="width:50px"/>
							           <h:outputText value="domácí:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.homeTeam}" style="width:150px"/>
							           <h:outputText value="hosté:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.awayTeam}" style="width:150px"/>
							           <h:outputText value="hlavní rozhodčí:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.mainReferee}" style="width:150px"/>
							           <h:outputText value="AR1:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.lineRefereeOne}" style="width:150px"/>
							           <h:outputText value="AR2:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.lineRefereeTwo}" style="width:150px"/>
							           <h:outputText value="DS:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.ds}" style="width:150px"/>
							           <h:outputText value="spolujízda:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.carpool}" style="width:150px"/>
							           <h:outputText value="poznámka:" />    						      
							           <h:inputText value="#{delegationczechBean.newdelegationczech.note}" style="width:150px"/>
							             	 		 
						        	</h:panelGrid> 
						        	<p:commandButton value="Vytvoř delegaci"  actionListener="#{delegationczechBean.createDelegationczech}" update=":detailDelegace,:delegationNewDialog,:growl" oncomplete="delegationNewDialog.hide()" />
						        </h:form>	
								</p:dialog>
								
								<p:dialog id="delegationEditDialog" header="Editovat delegaci" widgetVar="delegationEditDialog" resizable="false"  
					              width="300" showEffect="clip" hideEffect="fold" position="10,10">  
						      	<h:form>
						      	 <h:panelGrid columns="2" cellpadding="4">
						      	       <h:outputText value="Soutěž:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.competion}" style="width:150px"/>  
							           <h:outputText value="Datum:" />    						      
							           <p:inputMask value="#{delegationczechBean.selecteddelegationczech.date}" mask="99.99.9999" style="width:70px"/>
							           <h:outputText value="čas:" />    						      
							           <p:inputMask value="#{delegationczechBean.selecteddelegationczech.time}" mask="99:99" style="width:50px"/>
							           <h:outputText value="domácí:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.homeTeam}" style="width:150px"/>
							           <h:outputText value="hosté:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.awayTeam}" style="width:150px"/>
							           <h:outputText value="hlavní rozhodčí:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.mainReferee}" style="width:150px"/>
							           <h:outputText value="AR1:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.lineRefereeOne}" style="width:150px"/>
							           <h:outputText value="AR2:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.lineRefereeTwo}" style="width:150px"/>
							           <h:outputText value="DS:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.ds}" style="width:150px"/>
							           <h:outputText value="spolujízda:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.carpool}" style="width:150px"/>
							           <h:outputText value="poznámka:" />    						      
							           <h:inputText value="#{delegationczechBean.selecteddelegationczech.note}" style="width:150px"/>
							           
						        	</h:panelGrid> 
						        	<p:commandButton value="Uložit změny"  actionListener="#{delegationczechBean.updateDelegationczech}" update=":detailDelegace,:delegationNewDialog,:growl" oncomplete="delegationEditDialog.hide()" />
						        </h:form>	
					 </p:dialog>
								
					  	       </h:panelGrid> 
													 					  	                   		    
							</p:panel>  	  
					</h:panelGrid>
				</p:panel>			
		</ui:composition>	
	</h:body>
</html>